fix: make Bash tool validation rule contextual for workflow commands#101
fix: make Bash tool validation rule contextual for workflow commands#101
Conversation
The previous rule "MUST use Bash(gh:*) not unrestricted Bash" was too restrictive for workflow/scaffolding commands like create-plugin and create-marketplace that legitimately need filesystem operations (mkdir, git init, directory creation). Changes: - Use correct official Bash pattern syntax (prefix matching with :*) - Allow unrestricted Bash when command purpose justifies it - Provide examples of proper Bash prefix patterns This enables PR #100 to pass validation while maintaining security guidance for simpler commands. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished @sjnims's task in 1m 14s —— View job PR Review: Contextual Bash Tool Validation Rule
Summary✅ Looks good - This is a well-reasoned improvement to the validation workflow that makes the Bash tool restriction contextual and corrects the syntax. What's Good
VerificationI examined
This PR correctly unblocks that command while maintaining security guidance for simpler commands. Checklist Verification✅ Workflow syntax: The validation rule syntax is correct RecommendationApprove and merge. This PR:
|
Summary
Updates the component validation workflow to use a contextual Bash tool rule instead of a blanket restriction, and corrects the Bash pattern syntax to match official documentation.
Problem
The validation rule at line 99 was:
This caused PR #100 to fail validation because
create-plugin.mduses unrestrictedBash- but it legitimately needs broader access for:mkdir -p- creating plugin directory structuresgit init- initializing git repositoriesAdditionally, the syntax
Bash(gh:*)doesn't match official documentation, which specifies prefix matching with:*(e.g.,Bash(gh pr:*)).Solution
Updated the validation rule to be contextual:
Bash(gh pr:*),Bash(npm run:*)Bashwhen the command's purpose justifies filesystem operations:*wildcard notation per official docsAlternatives Considered
Changes
.github/workflows/component-validation.yml: Updated Bash validation rule (lines 99-100)Testing
Related
🤖 Generated with Claude Code